import React, { PureComponent } from 'react';
import { connect } from 'dva';
import { Row, Col } from 'antd';
import styles from './index.less';
import 'moment/locale/zh-cn';
import { ModalC } from '../../../comps';

@connect(({ stationModel, loading }) => ({
  stationModel,
  loading,
}))
export default class instModal extends PureComponent {
  render() {
    const { saveVisible, titleModal, cancel, menuTable, saveModal, userTable, confirmRevise } = this.props;

    return (
      <ModalC
        title={titleModal}
        visible={saveVisible}
        onOk={confirmRevise}
        onCancel={cancel}
        width={850}
        confirmLoading={this.props.loading.effects['roleModel/saveTable'] == true}
      >
        <div className={styles.tableListForm}>
          <Row>
            <Col> {saveModal()}</Col>
          </Row>
          <Row style={{ marginTop: '10px' }}>
            <Col>
              <div
                style={{
                  display: 'flex' /* 弹性布局 */,
                  justifyContent: 'space-between',
                }}
              >
                <div style={{ flex: '1', marginRight: '20px' }}>{menuTable()}</div>
                <div style={{ flex: '1' }}>{userTable()}</div>
              </div>
            </Col>
          </Row>
        </div>
      </ModalC>
    );
  }
}
